package com.yang.reflectionstudy;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class demo01 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Class<?> aClass = Class.forName("com.yang.Student");
        Constructor<?> con = aClass.getConstructor(String.class, int.class, String.class);
        Object o = con.newInstance("杨琛", 30, "烟台");
        System.out.println(o);

        con.setAccessible(true);

    }
}
